import path from 'path'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import postCssPxToRem from "postcss-pxtorem"

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: {
      "@": path.resolve(__dirname,'src')
    },
  },
  css:{
    postcss:{
      plugins: [postCssPxToRem({
        rootValue: 37.5, // 1rem的大小
        propList: ['*'], // 需要转换的属性，这里选择全部都进行转换
      })]
    }
  },
  server: {
    /* proxy: {
      '/api': {
        target: 'https://bbs-api.mihoyo.com',
        changeOrigin: true,
        pathRewrite: {
          "^/api": ""
        }
      }
    } */
  }
})
